1. Field of the Invention
The present invention relates generally to a threshold value setting circuit, and is directed more particularly to a threshold value setting circuit suitable for use with an apparatus for extracting a specific pattern.
2. Description of the Prior Art
In the art, there have been proposed various methods to catch picture information from a video sensor or the like and then to extract a specific pattern from the picture information. For example, it is proposed that when a screen, which consists of a number of picture elements arranged in the vertical and horizontal direction (or mesh pattern), is scanned, the screen is divided into a plurality of small picture screens each consisting of 3.times.3=9 picture elements which is then detected to determine whether a specific pattern exists on the screen or not. In such a case, it is usual that the extraction of the specific pattern is achieved with the information being divided into two values of white and black. Namely, in general, such a floating method is used in which a certain threshold value is set for the zero potential and then a value higher than the threshold value is judged as the white level while a value lower than the threshold level is judged as a black level, or an average value of the bright and dark levels of a picture screen is set as a threshold level and then the + side thereof is judged as the white level while the - side thereof is judged as the black level.
In the above threshold value setting method, it becomes a problem how to set the threshold value without being affected by scratches, dirty portions and so on of a pattern, how to adjust the light source which will irradiate the picture screen, and how to adjust the gain of an amplifier used therein. That is, if much attention is not paid to the above operations, it is impossible to accurately extract a specific pattern.
Now, an example of the prior art pattern extracting method will be described with reference to FIGS. 1A, 1B, 2A, 2B, 3A, 3B, 4A and 4B. As shown in the figures, a picture screen (the whole screen is not shown in the figure) is divided into a plurality of small picture screens each consisting of 3.times.3=9 picture elements P1, P2, . . . P8, P9 which are arranged in the vertical and horizontal directions (one small picture screen is shown in FIGS. 1A to 3B). In this case, an inverse L-shaped pattern PL, which is an example of the specific patterns, will be extracted from the screen. Therefore, in this case, the specific pattern PL is projected onto the picture elements P1, P2, P3, P4 and P7 of the small picture screen as shown in FIGS. 1A, 2A and 3A. If it is assumed that the information from the respective picture elements are accurately made as two values, the picture elements P1, P2, P3, P4 and P7 become the black level, while the picture elements P5, P6, P8 and P9 become the white level as shown in FIG. 1B.
While, if, for example, a dirty portion exists on one of picture elements such as the picture element P8 as shown in FIG. 2A, the information from the picture element P8, which should be in the white level, may be judged as the black level as shown in FIG. 2B dependent upon the manner in which the threshold value is set.
That is, as shown in FIG. 4A by a dotted line, if a threshold value SH is set at a relativly high value near a white level W (in FIG. 4A, WL represents a portion of the white level and IL and BL respectively represent black level portions), the picture element P8, which contains the dirty portion, is at a level lower than the threshold level SH (in this case, it becomes the level IL). Thus, the picture element P8 is erroneously judged as the black level, and accordingly it becomes impossible to accurately judge the pattern.
In order to avoid the above erroneous judgement, if the threshold value is lowered to SHL40 as shown in FIG. 4B by a dotted line, another defect will be caused. That is, if, for example, a scratch is present on, for example, the picture element P2 (on which a part of the pattern PL is projected and hence which is in the black level) as shown in FIG. 3A, the level of the picture element P2 becomes the level IL and is higher than the threshold level SH' as shown in FIG. 4B. Thus, the picture element P2 is erroneously judged as the white level. Accordingly, the case of FIG. 3A is such that a part of the black portion of the small picture screen is cut away i.e. the picture element P2, which is to be a black portion by the projection of the pattern, becomes the white level as shown in FIG. 3B.
Accordingly, in the prior art, the threshold value must be carefully set in consideration of various conditions as set forth above, which is troublesome and further, the threshold value is easily affected by the background of the pattern.